const mongoose = require('mongoose');

mongoose.connect('mongodb://localhost/students', { useUnifiedTopology: true }, { useNewUrlParser: true });
const Schema = mongoose.Schema;

const studentSchema = new Schema({
	name: {
		type: String,
		required: true
	},
	gender: {
		type: String,
		enum: ['0', '1'],
		required: true
	},
	age: {
		type: Number
	},
	hobbies: {
		type: String
	}
});


module.exports = mongoose.model('Student', studentSchema);